﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyBlog.Model
{
    public class BlogNews : BaseId
    {
        // nvarchar带中文比较好
        /// <summary>
        /// 标题
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(30)")]
        public string Title { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        [SugarColumn(ColumnDataType = "text")]
        public string Content { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Time { get; set; }
        /// <summary>
        /// 浏览次数
        /// </summary>
        public int BrowseCount { get; set; }
        /// <summary>
        /// 点赞
        /// </summary>
        public int LikeCount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int TypeId { get; set; }
        /// <summary>
        /// 作家ID
        /// </summary>
        public int WriterId { get; set; }

        [SugarColumn(IsIgnore = true)]//不需要映射到数据库
        public TypeInfo TypeInfo { get; set; }

        [SugarColumn(IsIgnore = true)]//不需要映射到数据库
        public WriterInfo WriterInfo { get; set; }

    }
}
